Skip to content

docs(admin): improve nginx config php location block structure and clarity#14172

Merged
susnux merged 9 commits intomasterfrom
jtr/improve-nginx-php-block-comments
Mar 27, 2026
Merged

docs(admin): improve nginx config php location block structure and clarity#14172
susnux merged 9 commits intomasterfrom
jtr/improve-nginx-php-block-comments

Conversation

@joshtrichards
Copy link
Copy Markdown
Member

☑️ Resolves

Improve the comments and formatting of the PHP block (location ~ \.php(?:$|/) {...}) in both nginx sample configuration files to make them clearer and more maintainable. Re-ordered the regex in the rewrite merely for logical clarity, but no functional changes.

Changes:

  • Rewrite the PHP location block comments to clearly document the front-controller rewrite regex, its exceptions, and why ordering matters
  • Reorder rewrite regex ordering to be slightly more logically grouped and, in turn, make easier to document/follow (core entry points / OCS endpoints / update/updater endpoints / app exceptions)
  • Add explanatory comments to previously uncommented directives
  • Add a file header identifying each sample as root vs. subdirectory installation
  • Add upstream block heading comment clarifying "use one, not both"
  • Fix mixed tab/space indentation in the types block
  • Align both sample files to use a consistent comment style

🖼️ Screenshots

root installation:
image

subdirectory installation:
image

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
joshtrichards and others added 2 commits March 27, 2026 10:51
…gi_split_path_info result

Co-authored-by: MichaIng <micha@dietpi.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Copy link
Copy Markdown
Member

@MichaIng MichaIng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Explains much better the purpose of each directive, and helps to understand the general structure of typical PHP handler and rewrite blocks in Nginx 👍.

@susnux susnux merged commit 433aec0 into master Mar 27, 2026
11 checks passed
@susnux susnux deleted the jtr/improve-nginx-php-block-comments branch March 27, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants